WSL (Ubuntu)の初期設定手順
最初の画面
code:sh
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
Enter new UNIX username:
このあとusernameとpasswordを入力すればおしまい
ログ全文
IP addressとかは消してある
code:bash
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
Enter new UNIX username: takker
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)
System information as of Fri Oct 1 12:49:38 JST 2021
System load: 0.52
Usage of /home: unknown
Memory usage: 52%
Swap usage: 1%
Processes: 7
Users logged in: 0
IPv4 address for eth1:
IPv4 address for wifi0:
IPv6 address for wifi0:
IPv6 address for wifi0:
1 update can be applied immediately.
To see these additional updates run: apt list --upgradable
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
This message is shown once a day. To disable it please create the
/home/takker/.hushlogin file.
$
このあとやること
2. sudo apt update && sudo apt upgrade
$ cd && mkdir git && cd git
6. dotfilesをcloneする
$ git clone git@github.com:takker99/dotfiles.git
7. 必要なソフトを入れる
neovim
deno
yarn
rust
shell scriptでinstallも自動化したい……
code:bash
と思ったのだが、sourceの実行段階で謎のエラーが現れて実行できない……
どうすりゃええねんtakker.icon
code:install.sh
set -eu
catch () {
echo "Some error have occurred. Terminate the installation."
}
trap catch ERR
if !(type "nvim" > /dev/null 2>&1); then
echo "neovim is not installed. Install neovim..."
sudo apt install neovim -y
echo "Successfully installed neovim."
fi
if !(type "batcat" > /dev/null 2>&1); then
echo "bat is not installed. Install bat..."
sudo apt install bat -y
echo "Successfully installed bat."
fi
# required to install deno
if !(type "unzip" > /dev/null 2>&1); then
echo "unzip is not installed. Install unzip..."
sudo apt install unzip -y
echo "Successfully installed unzip."
fi
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
if !(type "deno" > /dev/null 2>&1); then
echo "deno is not installed. Install deno..."
echo "Successfully installed deno."
fi
code:install.sh
# required to install npm
export NVM_DIR="$HOME/.nvm"
if !(type "nvm" > /dev/null 2>&1); then
echo "nvm is not installed. Install nvm..."
echo "Successfully installed nvm."
fi
# required to install npm
if !(type "node" > /dev/null 2>&1); then
echo "Node.js is not installed. Install Node.js..."
nvm install node
code:install.sh
eval "cat <<< \"current Node version: $(node --version)\""
eval "cat <<< \"current npm version: $(npm --version)\""
echo "Successfully installed node and npm."
fi
if !(type "yarn" > /dev/null 2>&1); then
echo "yarn is not installed. Install yarn..."
npm install -g yarn
# use yarn V2
yarn set version berry
echo "Successfully installed yarn."
fi
if !(type "cargo" > /dev/null 2>&1); then
echo "Rust compile tools is not installed. Install rustup and cargo..."
echo "Successfully installed rustup."
fi
source $HOME/.cargo/env
if !(type "cc" > /dev/null 2>&1); then
echo "C/C++ compiler is not installed. Install clang..."
sudo apt install clang -y
echo "Successfully installed clang."
fi
if !(type "exa" > /dev/null 2>&1); then
echo "exa is not installed. Install exa..."
cargo install exa
echo "Successfully installed exa."
fi